-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replaces DeveloperError(s) with Check(s) in Ellipsoid #5425
Conversation
ae92872
to
08e2702
Compare
Source/Core/Ellipsoid.js
Outdated
throw new DeveloperError('All radii components must be greater than or equal to zero.'); | ||
} | ||
}*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this PR was submitted alongside #5424 it has some of the same issues. Do a pass over the file to make sure commented code is deleted, checks are within includeStart/includeEnd
, and the appropriate Check.typeOf
is used.
Source/Core/Ellipsoid.js
Outdated
throw new DeveloperError('Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)'); | ||
} | ||
|
||
Check.typeOf.number.greaterThan('_radii.z', this._radii.z, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the string to Ellipsoid.radii.z
to better match the original error.
Source/Core/Ellipsoid.js
Outdated
Check.defined('position', position); | ||
|
||
// While it would be more idiomatic to use a Check.typeOf.number.something here, | ||
// the resulting error message is a lot harder to read. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fine to remove this comment.
@AnimatedRNG after making code updates just leave a small message like "Updated" so everyone reviewing gets notified. |
There are still some areas with commented code and checks not within the debug pragmas. |
Updated |
Source/Core/Ellipsoid.js
Outdated
@@ -283,12 +285,16 @@ define([ | |||
*/ | |||
Ellipsoid.pack = function(value, array, startingIndex) { | |||
//>>includeStart('debug', pragmas.debug); | |||
if (!defined(value)) { | |||
/*if (!defined(value)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove comment.
Source/Core/Ellipsoid.js
Outdated
if (!defined(cartesian)) { | ||
throw new DeveloperError('cartesian is required.'); | ||
} | ||
Check.defined('cartesian', cartesian); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Check.typeOf.object
here.
Source/Core/Ellipsoid.js
Outdated
if (!defined(position)) { | ||
throw new DeveloperError('position is required.'); | ||
} | ||
Check.defined('position', position); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment.
Updated |
Looks good! |
Part of #4794